import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/views/login'
import layout from '@/views/layout'
import Backend from '@/views/backend/backend'

 


Vue.use(Router)

export default new Router({
  mode: 'history',
  redirect:'/Login',
  routes: [
    {
      path: '/',
      name: 'layout',
      redirect: 'Login',
      component: layout,
      children:[
        {
          path: 'home',
          name: 'layout',
          component: layout,
        },
        

      ]
    },
    {
      path: '/contact',
      name: 'contact',
      component: () =>import( '@/views/contact') 
    },
    {
      path: '/upload',
      name: 'upload',
      component: () =>import( '@/views/upload') 
    },
    {
      path: '/personCenter',
      name: 'personCenter',
      component: () =>import( '@/views/personCenter') 
    },
    {
      path: '/Login',
      name: 'Login',
      component: Login
    },
    {
      path: '/addRoom',
      name: 'addRoom',
      component: () =>import( '@/views/backend/addroom') 
    },
    {
      path: '/roomDetail',
      name: 'roomDetail',
      component: () =>import( '@/views/roomdetail') 
    },
    {
      path: '/backend',
      name: 'backend',
      component:Backend,
      children:[
        {
          path: '/roomList',
          name: 'roomList',
          component: () =>import( '@/views/backend/roomlist') 
        },
        {
          path: '/yongHuGuanLi',
          name: 'yongHuGuanLi',
          component: () =>import( '@/views/backend/yongHuGuanLi')
        },
        {
          path: '/orderManage',
          name: 'orderManage',
          component: () =>import( '@/views/backend/orderManage')
        }
      ]
    }
  ]
})
